<div class="cont6 ui-corner-all ui-widget-content" style="width:750px;padding:3px;border:1px solid #62BBE8;">
    <br>
    <?php echo $form->create('Mensaje',array('url'=>array('controller'=>'Home','action'=>'add')));?>
    <?php echo $html->link('Volver','#',array('class'=>'lnkbutton btnback ui-corner-all'));?>
    <?php echo $form->submit('Enviar',array('div'=>false,'class'=>'btnsendmail ui-corner-all'));?>
    <br/>
    <br/>
    <div class="clear"></div>    
    <div class="grid05b">Para</div>
    <div class="grid3">
        <?php echo $form->input('para',array('type'=>'text','label'=>false,'size'=>120,'class'=>'noUppercase'));?>
        <?php echo $form->hidden('de');?>
    </div>
    <div class="clear"></div>
    <div class="grid05b">Asunto</div>
    <div class="grid3">
        <?php echo $form->input('asunto',array('type'=>'text','label'=>false,'size'=>120,'class'=>'noUppercase'));?>
    </div>
    <div class="clear"></div>
    <div class="grid4" style="width:740px">
        <?php echo $form->input('contenido',array('type'=>'textarea','label'=>false,'id'=>'wysiwyg','class'=>'noUppercase'));?>
    </div>
    <div class="clear"></div>
    <?php echo $form->end();?>
</div>
<script type="text/javascript">
    $(function(){
        $('form#MensajeAddForm').bind('submit.notempty',function(){
            var to = $('input#MensajePara').val();
            var subject = $('input#MensajeAsunto').val();
            var body = $('input#wysiwyg').val();

            if ($.trim(to) == '') {
                alerta('La direccion destino es obligatoria');
                return false;
            }
            if ($.trim(subject) == '') {
                alerta('No se ha ingresado el asunto');
            }
        });
        $('input#MensajePara').autoComplete({
                ajax: _WEB_ROOT+"home/autocomplete",
                minChars:"1",
//                width:"650px",
                postVar:"query",
                onSelect: function(event, ui){
                    
                }
        });

        $('input#MensajePara').bind('keyup.autocomplete',function(){
            
        });
    });
</script>


